import { create, update, remove, query } from '../../../../../framework/service/index';

const proIcon = require('../../../../../icons/personal/default-avatar.jpg')
export default {

  namespace: 'myResume',

  state: {
    date: [],
    profile: {
      name: '',
      sex: '',
      age: 0,
      height: '',
      site: '',
      phone: '',
      email: '',
      skillArr: ['活动策划','活动策划','活动策划','活动策划']
    },
    resume: {},
    intentionData: {
      types: [],
      areas: [],
      wordTime: []
    }
  },

  subscriptions: {
    setup({ dispatch, history }) {
      history.listen(location => {
        if(location.pathname === '/my-resume') {
          dispatch({type: 'query', })
          dispatch({type: 'personal/query', })
        }
      })
    },
  },



  effects: {
    *query({ payload }, { call, put,select }) {
      const { code, data, message } = yield call(query, '/api/applicants/details', {});
      if ( code == 200 && data ) {
        // console.log('个人信息',data);
        yield put({
          type: 'querySuccess',
          payload: {
            // profile: data.profile,
          }
        })
      }
      const proIcon = proIcon
    }
  },

  reducers: {
    querySuccess(state, action) {
      return { ...state, ...action.payload };
    },
  }

};
